/* The file is part of the Waff web framework.
 *
 * Copyright (c) 2011, Grzegorz Skorupa
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditionsare met:
 *
 * - Redistributions of source code must retain the above copyright notice, this list of conditions
 *   and the following disclaimer.
 * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions
 *   and the following disclaimer in the documentation and/or other materials provided with the distribution.
 * - Neither the name of the Grzegorz Skorupa nor the names of its contributors may be used to endorse or promote products
 *   derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package pl.org.waff.repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

/**
 *
 * @author greg
 */
public interface ContentCache {
    public static int ERR_NO_ERROR=0;
    public static int ERR_DOCUMENT_IS_NULL=1;
    public static int ERR_PATH_IS_EMPTY=2;
    public static int ERR_TYPE_IS_NULL=3;
    public static int ERR_NOT_FOUND=4;
    public static int ERR_NOT_IMPLEMENTED=100;
    public void init();
    public Document getDocument(String id);
    public ArrayList findDocuments(String folderPath, String documentType, String status, String target);
    public ArrayList findDocuments(String folderPath, String documentType, String status, String target, String tag);
    public ArrayList findDocuments(String folderPath, String documentType, String queryString);
    public ArrayList findComments(String documentId, String status);
    public Properties getCommentsInfo(String documentId);
    public Comment getComment(String id);
    public ArrayList getSubfolders(String parentPath);
    public List getAllFolders();
    public List getAllTypes();
    public int putDocument(String folderPath, Document document);
    public int putComment(Comment comment);
    public void addFolder(String folderPath);
    public void addType(String typeName);
    public int trashDocument(String id);
    public int deleteDocument(String id);
    public int deleteComment(String id);
    public int deleteFolder(String path);
}
